Frame aggregation method, network setting frame sending method, and device

ABSTRACT

This application describes a frame aggregation method. A first forwarding node device receives a first data frame and a second data frame, where the first data frame includes a first MAC header and a first MSDU, the second data frame includes a second MAC header and a second MSDU, and a destination MAC address in the first MAC header is the same as a destination MAC address in the second MAC header; and generates a first aggregated frame, where the first aggregated frame includes an aggregated MAC header and an aggregated MSDU, the aggregated MSDU includes a first sub-MSDU and a second sub-MSDU, the first sub-MSDU includes the first MSDU and a source MAC address of the first data frame, and the second sub-MSDU includes the second MSDU and a source MAC address of the second data frame. A second forwarding node device sends the first aggregated frame.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of International Application No.PCT/CN2018/088091, filed on May 23, 2018, which claims priority toChinese Patent Application No. 201711221134.6, filed on Nov. 29, 2017.The disclosures of the aforementioned applications are herebyincorporated by reference in their entireties.

TECHNICAL FIELD

This application relates to the field of communications technologies,and in particular, to frame aggregation, and network setting.

BACKGROUND

The Wireless Smart Ubiquitous Network (Wi-SUN) Alliance proposes alow-power and wide-area wireless communications technology, namely, afield area network (FAN) technology, that can be applied to fields, suchas, smart metering, smart city, smart grid, smart farming, assetmanagement, and the like.

In an application scenario of data collection such as smart metering orenvironment monitoring or another application scenario, the Wi-SUN FANcan be networked in a cluster tree topology. Nodes that meet a presetcondition (for example, nodes that are close to each other) may form acluster, and nodes in a same cluster have a same address prefix. Nodesin the Wi-SUN FAN may be classified into a leaf node device, anintermediate forwarding node device, and a cluster head forwarding nodedevice. The cluster head forwarding node device may also be referred toas an aggregation node. Specifically, the leaf node device, for example,a smart meter or an environment monitoring device, may receive a packetand send a packet, but cannot forward a packet. The intermediateforwarding node device may provide a bidirectional packet forwardingfunction, and may further have all functions of the leaf node device.There is only one cluster head forwarding node device in a cluster, andthe cluster head forwarding node device may be a unique data uplinkchannel in the cluster, and may further have all functions of theintermediate forwarding node device.

The leaf node device forms a data frame after collecting data, andreports the data frame to the cluster head forwarding node device, orreports the data frame to the cluster head forwarding node device byusing the intermediate forwarding node device. The cluster headforwarding node device reports the data frame to a router through a pathto the router. The intermediate forwarding node device or the clusterhead forwarding node device may also report a data frame. In addition tothe collected data, a physical layer (PHY) header, a media accesscontrol (MAC) header, a frame check sequence (FCS), and the like may beadded to the reported data frame, and consequently protocol overheadsare relatively high, and resource usage is relatively low. In addition,in a carrier sense multiple access with collision avoidance (CSMA/CA)sending manner, channel contention needs to be performed each timebefore the data frame is sent. Therefore, when a relatively large numberof nodes report data frames, a relatively large quantity of channelcontentions are performed, which may cause relatively low channelresource usage and reduce system throughput.

SUMMARY

This application provides a frame aggregation method, a network settingframe sending method, and a device, to aggregate data frames, therebyhelping increase channel resource usage and improve system performance.

According to a first aspect, an embodiment of this application providesa frame aggregation method that may be applied to a Wi-SUN FAN.

The frame aggregation method includes a first forwarding node devicereceives a first data frame sent by a first node device and a seconddata frame sent by a second node device, where the first data frameincludes a first MAC header and a first MSDU, and the second data frameincludes a second MAC header and a second MSDU. The first forwardingnode device determines that a destination MAC address in the first MACheader is the same as a destination MAC address in the second MACheader, and generates a first aggregated frame based on the first dataframe and the second data frame, where the first aggregated frameincludes a first aggregated MAC header and a first aggregated MSDU, adestination MAC address in the first aggregated MAC header is the sameas the destination MAC address in the first MAC header or thedestination MAC address in the second MAC header, the first aggregatedMSDU includes a first sub-MSDU and a second sub-MSDU, the first sub-MSDUincludes the first MSDU and a source MAC address in the first MACheader, and the second sub-MSDU includes the second MSDU and a sourceMAC address in the second MAC header. The first forwarding node devicesends the first aggregated frame to a second forwarding node device.

According to the foregoing method, the first forwarding node device mayaggregate received data frames that have a same destination MAC address,thereby helping reduce packet overheads and a quantity of channelcontentions.

In a possible implementation, the first node device, the second nodedevice, and the first forwarding node device may belong to a firstcluster, and the first cluster is included in the Wi-SUN FAN. The firstnode device may be a leaf node device or an intermediate forwarding nodedevice, and if the first node device is the intermediate forwarding nodedevice, the first data frame may be a data frame that is not aggregated,or may be an aggregated frame. The second node device may also be a leafnode device or an intermediate forwarding node device, and if the secondnode device is the intermediate forwarding node device, the second dataframe may be a data frame that is not aggregated, or may be anaggregated frame.

According to the foregoing method, the first forwarding node device mayaggregate data frames that are not aggregated or aggregated frames thatare sent by a leaf node device or an intermediate forwarding node devicein a cluster to which the first forwarding node device belongs, forexample, the first forwarding node device may aggregate data frames thatare sent by two leaf node devices, or may aggregate frames that are sentby two intermediate forwarding node devices, or may aggregate framesthat are sent by the leaf node device and the intermediate forwardingnode device. Specifically, the first forwarding node device mayaggregate two data frames that are not aggregated, or may aggregate twoaggregated frames again, or may aggregate a data frame that is notaggregated and an aggregated frame.

In a possible implementation, the first forwarding node device and thesecond node device may belong to a first cluster, but the first nodedevice is a cluster head forwarding node device in a second cluster. Thecorresponding first data frame is an aggregated frame, and the firstcluster and the second cluster are different clusters, but are includedin the Wi-SUN FAN.

According to the foregoing method, the first forwarding node device mayaggregate a data frame that is sent by a node device in a cluster towhich the first forwarding node device belongs and an aggregated framesent by a cluster head node in another cluster. Optionally, the secondnode device may be the leaf node device or the intermediate forwardingnode device.

In a possible implementation, the first forwarding node device is anintermediate forwarding node device, the second forwarding node deviceis a cluster head forwarding node device or an intermediate forwardingnode device, the first forwarding node device and the second forwardingnode device belong to a same cluster.

In a possible implementation, the first forwarding node device and thesecond forwarding node device belong to different clusters, the firstforwarding node device is a cluster head forwarding node device, thesecond forwarding node device is an intermediate forwarding node deviceor a cluster head forwarding node device, and both the first forwardingnode device and the second forwarding node device belong to the Wi-SUNFAN.

According to the foregoing method, the first forwarding node device maybe the cluster head forwarding node device, and sends the generatedaggregated frame to an intermediate forwarding node device or a clusterhead forwarding node device in a previous hop. Optionally, the secondforwarding node device may further aggregate the first aggregated framesent by the first forwarding node device and a data frame sent byanother node device in a cluster in which the second forwarding nodedevice is located.

In a possible implementation, the first forwarding node device is acluster head forwarding node device, the second forwarding node deviceis a border router, and the border router is not included in the Wi-SUNFAN.

In a possible implementation, the first forwarding node device is acluster head forwarding node device. The first forwarding node devicemay further receive a network setting frame from a border router, wherethe network setting frame is used to indicate a time at which the firstforwarding node device reports the first aggregated frame and a time atwhich each of the first node device and the second node device collectsdata. The first forwarding node device determines, based on the networksetting frame, a deadline for reporting the first aggregated frame; andsends the first aggregated frame to the second forwarding node devicebased on the deadline.

It should be understood that the foregoing network setting frame fromthe border router is generated by the border router, but is notnecessarily directly sent by the border router to the first forwardingnode device. For example, the border router sends the network settingframe to a cluster head forwarding node device connected to the borderrouter, and the cluster head forwarding node device sends the networksetting frame to a leaf node device, an intermediate forwarding nodedevice, or a cluster head forwarding node device in another cluster thatis connected to the cluster head forwarding node device.

According to the method, the first forwarding node device determines,based on the network setting frame, the deadline for sending the firstaggregated frame, thereby helping ensure time validity of data, andavoid a case in which the first forwarding node device cannot uploaddata that is collected by each node device to an upper-layer applicationin a timely manner due to a long-time wait for receiving the data frame.

In a possible implementation, the network setting frame may include anetwork setting timestamp, a cluster hop count, and a sample period, thenetwork setting timestamp is used to determine a reference time of thesample period, the cluster hop count represents a hop count to a clusterin which a destination node device is located from the border routerthat sends the network setting frame, and the sample period is used toinstruct the first node device and the second node device to collectdata based on the sample period. Specifically, the first forwarding nodedevice may obtain a first time based on the network setting timestampand the sample period; remove deadline gradients whose quantity is thecluster hop count from the first time, to obtain the deadline, where thedeadline gradient is used to indicate a time required by the firstforwarding node device to send the first aggregated frame to aforwarding node device outside the cluster in which the first forwardingnode device is located; and increase the cluster hop count in thenetwork setting frame by 1.

In another possible implementation, the first forwarding node device mayalternatively first increase the cluster hop by 1, and then obtain thedeadline according to the foregoing method.

Optionally, the deadline gradient may be added to the network settingframe and sent to the first forwarding node device, or the deadlinegradient may be preconfigured for the first forwarding node device.

In a possible implementation, both the first sub-MSDU and the secondsub-MSDU include a length field that is used to indicate a length of asub-MSDU. Because the first aggregated MSDU in the first aggregatedframe may include a plurality of sub-MSDUs, a length of each sub-MSDU isindicated by using the length field, so that another device candistinguish between a previous sub-MSDU and a current sub-MSDU whenparsing the aggregated frame.

According to a second aspect, an embodiment of this application providesa network setting frame sending method, including:

A border router obtains a network setting parameter, where the networksetting parameter includes a sample period, and the sample period isused to instruct a node device to collect data based on the sampleperiod. The border router generates a network setting frame based on thenetwork setting parameter, where the network setting frame includes anetwork setting timestamp, a cluster hop count, and the sample period,the network setting timestamp is used to determine a reference time ofthe sample period, and the cluster hop count represents a hop count to acluster in which a destination node device is located from the borderrouter that sends the network setting frame. The border router sends thenetwork setting frame to a cluster head forwarding node device, wherethe cluster head forwarding node device is located in a first cluster ina Wi-SUN FAN, and the first cluster communicates with the border routerby using the cluster head forwarding node device.

According to the foregoing method, the border router generates thenetwork setting frame based on the obtained network setting parameter,and sends the network setting frame to each node device in the Wi-SUNFAN by using the cluster head forwarding node device connected to theborder router, so that each node device determines the sample period andcollects data based on the sample period. Further, each forwarding nodedevice may further determine, based on a deadline gradient and thenetwork setting frame, a deadline for sending an aggregated frame, toensure time validity of data collection.

In a possible implementation, the network setting parameter furtherincludes a sample time advance that is used to indicate a sample time ofthe node device in a sample period; and correspondingly, the networksetting frame generated by the border router may further include thesample time advance. The sample time advance is set, so that each nodedevice may determine the sample time based on the sample time advanceand the sample period, and further, each node device has a uniformsample time.

In a possible implementation, the border router receives an aggregatedframe sent by the cluster head forwarding node device, where theaggregated frame is obtained by aggregating only a first data frame sentby a first node device and a second data frame sent by a second nodedevice, both the first node device and the second node device belong tothe Wi-SUN FAN, the first data frame includes a first MAC header and afirst MSDU, the second data frame includes a second MAC header and asecond MSDU, a destination MAC address in the first MAC header is thesame as a destination MAC address in the second MAC header, theaggregated frame includes a first aggregated MAC header and a firstaggregated MSDU, a destination MAC address in the first aggregated MACheader is the same as the destination MAC address in the first MACheader or the destination MAC address in the second MAC header, thefirst aggregated MSDU includes a first sub-MSDU and a second sub-MSDU,the first sub-MSDU includes the first MSDU and a source MAC address inthe first MAC header, and the second sub-MSDU includes the second MSDUand a source MAC address in the second MAC header.

According to the foregoing method, the border router may receive theaggregated frame sent by the cluster head forwarding node device.Because the first aggregated frame is obtained by aggregating dataframes that have a same destination MAC address, thereby helping reducepacket overheads and a quantity of channel contentions.

According to a third aspect, an embodiment of this application providesa first forwarding node device. The first forwarding node device isapplied to a wireless smart ubiquitous network Wi-SUN field area networkFAN, the Wi-SUN FAN includes the first forwarding node device, a firstnode device, and a second node device, and the first forwarding nodedevice has a function of implementing an action of the first forwardingnode device in the foregoing frame aggregation method. The function maybe implemented by hardware, or may be implemented by hardware executingcorresponding software. The hardware or the software includes one ormore modules corresponding to the foregoing function.

In a possible implementation, a structure of the first forwarding nodedevice includes a processor and an interface. The processor isconfigured to support the first forwarding node device in performingcorresponding functions in the foregoing method. The interface isconfigured to support communication between the first forwarding nodedevice and the first node device, the second node device, and a secondforwarding node device. The first forwarding node device may furtherinclude a memory. The memory is configured to couple to the processor,and the memory stores a program instruction and data that are necessaryfor the first forwarding node device.

In another possible design, the first forwarding node device includes aprocessor, a receiver, a transmitter, a random access memory, aread-only memory, and a bus. The processor is coupled to the receiver,the transmitter, the random access memory, and the read-only memory byusing the bus. When the first forwarding node device needs to run, abasic input/output system built into the read-only memory or abootloader in an embedded system is used to boot a system to start, andboot the first forwarding node device to enter a normal running state.After entering the normal running state, the first forwarding nodedevice runs an application program and an operating system in the randomaccess memory, so that the processor performs the method according toany one of the first aspect or the possible implementations of the firstaspect.

According to a fourth aspect, a first forwarding node device isprovided. The first forwarding node device includes a main control boardand an interface board, and may further include a switching board. Thefirst forwarding node device is configured to perform the methodaccording to any one of the first aspect or the possible implementationsof the first aspect. Specifically, the first forwarding node deviceincludes a module configured to perform the method according to any oneof the first aspect or the possible implementations of the first aspect.

According to a fifth aspect, a first forwarding node device is provided.The first forwarding node device includes a controller and a firstforwarding sub-device. The first forwarding sub-device includes aninterface board, and may further include a switching board. The firstforwarding sub-device is configured to perform a function of theinterface board according to the fourth aspect, and may further performa function of the switching board according to the fourth aspect. Thecontroller includes a receiver, a processor, a transmitter, a randomaccess memory, a read-only memory, and a bus. The processor is coupledto the receiver, the transmitter, the random access memory, and theread-only memory by using the bus. When the controller needs to run, abasic input/output system built into the read-only memory or abootloader in an embedded system is used to boot a system to start, andboot the controller to enter a normal running state. After entering thenormal running state, the controller runs an application program and anoperating system in the random access memory, so that the processorperforms a function of the main control board according to the fourthaspect.

According to a sixth aspect, an embodiment of this application providesa border router. The border router has a function of implementing anaction of the border router in the foregoing network setting framesending method. The function may be implemented by hardware, or may beimplemented by hardware executing corresponding software. The hardwareor the software includes one or more modules corresponding to theforegoing function.

In a possible implementation, a structure of the border router includesa processor and an interface. The processor is configured to support theborder router in performing a corresponding function in the foregoingmethod. The interface is configured to support communication between theborder router and a cluster head forwarding node device. The borderrouter may further include a memory. The memory is configured to coupleto the processor, and the memory stores a program instruction and datathat are necessary for the border router.

In another possible design, the border router includes a processor, areceiver, a transmitter, a random access memory, a read-only memory, anda bus. The processor is coupled to the receiver, the transmitter, therandom access memory, and the read-only memory by using the bus. Whenthe border router needs to run, a basic input/output system built intothe read-only memory or a bootloader in an embedded system is used toboot a system to start, and boot the border router to enter a normalrunning state. After entering the normal running state, the borderrouter runs an application program and an operating system in the randomaccess memory, so that the processor performs the method according toany one of the second aspect or the possible implementations of thesecond aspect.

According to a seventh aspect, a border router is provided. The borderrouter includes a main control board and an interface board, and mayfurther include a switching board. The border router is configured toperform the method according to any one of the second aspect or thepossible implementations of the second aspect. Specifically, the borderrouter includes a module configured to perform the method according toany one of the second aspect or the possible implementations of thesecond aspect.

According to an eighth aspect, a border router is provided. The borderrouter includes a controller and a first forwarding sub-device. Thefirst forwarding sub-device includes an interface board, and may furtherinclude a switching board. The first forwarding sub-device is configuredto perform a function of the interface board according to the seventhaspect, and may further perform a function of the switching boardaccording to the seventh aspect. The controller includes a receiver, aprocessor, a transmitter, a random access memory, a read-only memory,and a bus. The processor is coupled to the receiver, the transmitter,the random access memory, and the read-only memory by using the bus.When the controller needs to run, a basic input/output system built intothe read-only memory or a bootloader in an embedded system is used toboot a system to start, and boot the controller to enter a normalrunning state. After entering the normal running state, the controllerruns an application program and an operating system in the random accessmemory, so that the processor performs a function of the main controlboard according to the seventh aspect.

According to a ninth aspect, a Wi-SUN FAN is provided. The Wi-SUN FANincludes the first forwarding node device in any one of the foregoingembodiments.

According to a tenth aspect, a computer-readable storage medium isprovided. The computer-readable storage medium stores a computerinstruction, and when the instruction is run on a computer, the computeris enabled to perform the method according to the first aspect or thesecond aspect.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a schematic diagram of an application scenario of a Wi-SUN FANaccording to an embodiment of this application;

FIG. 2 is a schematic structural diagram of a data frame according to anembodiment of this application;

FIG. 3 is a schematic structural diagram of a payload informationelement in a data frame according to an embodiment of this application;

FIG. 4 is a schematic structural diagram of a sample time informationelement in a data frame according to an embodiment of this application;

FIG. 5 is a schematic flowchart of a frame aggregation method accordingto an embodiment of this application;

FIG. 6 is a first schematic structural diagram of an aggregated frameaccording to an embodiment of this application;

FIG. 7 is a first schematic structural diagram of a sub-MSDU accordingto an embodiment of this application;

FIG. 8 is a second schematic structural diagram of an aggregated frameaccording to an embodiment of this application;

FIG. 9 is a second schematic structural diagram of a sub-MSDU accordingto an embodiment of this application;

FIG. 10 is a third schematic structural diagram of a sub-MSDU accordingto an embodiment of this application;

FIG. 11 is a third schematic structural diagram of an aggregated frameaccording to an embodiment of this application;

FIG. 12 is a fourth schematic structural diagram of an aggregated frameaccording to an embodiment of this application;

FIG. 13 is a fifth schematic structural diagram of an aggregated frameaccording to an embodiment of this application;

FIG. 14 is a schematic structural diagram of a network setting frameaccording to an embodiment of this application;

FIG. 15 is a schematic structural diagram of a payload informationelement in a network setting frame according to an embodiment of thisapplication;

FIG. 16 is a schematic structural diagram of a version numberinformation element in a network setting frame according to anembodiment of this application;

FIG. 17 is a schematic structural diagram of a frame aggregationinformation element in a network setting frame according to anembodiment of this application;

FIG. 18 is a schematic flowchart of a network setting frame sendingmethod according to an embodiment of this application;

FIG. 19 is a first schematic structural diagram of a first forwardingnode device according to an embodiment of this application;

FIG. 20 is a second schematic structural diagram of a first forwardingnode device according to an embodiment of this application;

FIG. 21 is a third schematic structural diagram of a first forwardingnode device according to an embodiment of this application;

FIG. 22 is a fourth schematic structural diagram of a first forwardingnode device according to an embodiment of this application;

FIG. 23 is a first schematic structural diagram of a border routeraccording to an embodiment of this application;

FIG. 24 is a second schematic structural diagram of a border routeraccording to an embodiment of this application;

FIG. 25 is a third schematic structural diagram of a border routeraccording to an embodiment of this application; and

FIG. 26 is a fourth schematic structural diagram of a border routeraccording to an embodiment of this application.

DETAILED DESCRIPTION OF EXAMPLE EMBODIMENTS

To make the objectives, technical solutions, and advantages of thisapplication clearer, the following further describes this application indetail with reference to the accompanying drawings.

FIG. 1 shows an example of an application scenario of an example Wi-SUNFAN. As shown in the figure, the Wi-SUN FAN includes node devices in acluster 1, a cluster 2, a cluster 3, and a cluster 4. Although FIG. 1shows a border router and a router, the border router and the router donot belong to the Wi-SUN FAN in this embodiment of this application. Acluster head forwarding node device in the cluster 2 is connected to anintermediate forwarding node device in the cluster 1, in other words,the cluster 1 is a previous hop of the cluster 2. A cluster headforwarding node device in the cluster 3 is connected to an intermediateforwarding node device in the cluster 2, in other words, the cluster 2is a previous hop of the cluster 3. Cluster head forwarding node devicesin the cluster 1 and the cluster 4 are each directly connected to theborder router. A cluster hop count of each of the cluster 1 and thecluster 4 may be set to 1, a cluster hop count of the cluster 2 may beset to 2, and a cluster hop count of the cluster 3 may be set to 3, or,alternatively, a cluster hop count of each of the cluster 1 and thecluster 4 may be set to 0, a cluster hop count of the cluster 2 may beset to 1, and a cluster hop count of the cluster 3 may be set to 2.

A data collection scenario such as smart metering or environmentmonitoring shown in FIG. 1 is used as an example. A smart water meter, asmart meter, or an environment monitoring device (which may be a leafnode device, an intermediate forwarding node device, or a cluster headforwarding node device) usually needs to periodically report collecteddata to a network, so that a user can monitor and manage the collecteddata over the network.

Each node may encapsulate the collected data into a data frame (namely,a data frame before aggregation) shown in FIG. 2, and send the dataframe to a previous node.

Specifically, as shown in FIG. 2, a MAC layer header includes a framecontrol field, a sequence number field, a destination MAC address field,a source MAC address field, an auxiliary security header (AUX securityheader), and a header information element (header IE). The frame controlfield is used to provide an information index for parsing a frame. Thesequence number field represents a number that is set for the data frameby the node that sends the data frame. The destination MAC addressrepresents a MAC address of a destination device of the data frame. Theauxiliary security header is used to indicate a key that is requiredwhen the data frame is decrypted, for example, an index value of thekey. The header information element is used to indicate a type of thedata frame and a time point at which the data frame is sent in a localunicast timeslot.

A MAC layer service data unit (MSDU) includes a payload informationelement and frame payload data, where the payload information element isused to indicate information such as a length and a type of the MSDU,and the frame payload data includes data collected by a node.

Further, as shown in FIG. 3, the payload information element may includethe length of the MSDU, a group identifier, a payload information type,a sample time information element, another payload information element,and a payload termination information element. As shown in FIG. 4, thesample time information element may include a length, an ID, a type, anda sample time.

An FCS field is used to check the data frame. Specifically, a senderperforms calculation on the data frame based on a preset algorithm, toobtain a calculation result, and a receiver performs calculation on thedata frame by using the same algorithm after receiving the data frame.If a calculation result of the receiver is the same as the received FCSfield, it is considered that the received data frame is correct;otherwise, the receiver considers that an error occurs in the dataframe, and discards the data frame.

Therefore, each node needs to send the foregoing information by using alarge quantity of bytes when sending a data frame. However, when arelatively large quantity of nodes each sends data frames including itscollected data, a plurality of channel contentions need to be performed,and consequently channel resource usage and system throughput areaffected.

To resolve the foregoing technical problem, an embodiment of thisapplication provides a frame aggregation method, applied to the Wi-SUNFAN, to aggregate data frames, thereby helping increase channel resourceusage, reduce a quantity of contentions, and improve system performance.

The frame aggregation method provided in this embodiment of thisapplication may be applied to the Wi-SUN FAN shown in FIG. 1. However, anetwork structure shown in FIG. 1 constitutes no limitation on thisapplication. It should be understood that a scenario to which thisembodiment of this application can be applied may include more or fewerclusters than those shown in FIG. 1. In addition, a cluster headforwarding node device in a next hop may be further connected to acluster head forwarding node device in a current hop. For example, acluster head forwarding node device 2 may be connected to a cluster headforwarding node device 1, and a cluster head forwarding node device 3may be connected to the cluster head forwarding node device 2. This isnot limited in this embodiment of this application.

FIG. 5 is a schematic flowchart of a frame aggregation method accordingto an embodiment of this application. As shown in the figure, the methodmay include the following steps.

Step 501: A first forwarding node device receives a first data framesent by a first node device and a second data frame sent by a secondnode device.

The first data frame includes a first MAC header and a first MSDU, andthe second data frame includes a second MAC header and a second MSDU.Formats of the first MAC header and the second MAC header may be shownin FIG. 2, but are not limited to the MAC header shown in FIG. 2, andmay include less or more MAC information than that shown in FIG. 2. TheMSDU in the data frame includes reported data. For example, if the firstnode device is a smart meter, current electricity consumption collectedby the smart meter is included in the MSDU.

Optionally, the first forwarding node device may be a cluster headforwarding node device, or may be an intermediate forwarding nodedevice, to be specific, both the cluster head forwarding node device andthe intermediate forwarding node device may aggregate received dataframes by using the frame aggregation method provided in this embodimentof this application.

As shown in FIG. 1, the cluster head forwarding node device may beconnected to a leaf node device and an intermediate forwarding nodedevice that are in a cluster in which the cluster head forwarding nodedevice is located, to be specific, may receive data frames sent by theleaf node device and the intermediate forwarding node device in thecluster. Therefore, in the foregoing step, the first data frame receivedby the first forwarding node device may be the data frame sent by theleaf node device in the cluster, or may be the data frame sent by theintermediate forwarding node device in the cluster, and the second dataframe may be the data frame sent by the leaf node device in the cluster,or may be the data frame sent by the intermediate forwarding node devicein the cluster.

For example, as shown in FIG. 1, if a cluster head forwarding nodedevice C1 is used as the first forwarding node device, the cluster headforwarding node device C1 may receive and aggregate data frames sent byan intermediate forwarding node device Z1 and an intermediate forwardingnode device Z2 in the cluster 1. If the intermediate forwarding nodedevice Z1 is used as the first forwarding node device, the intermediateforwarding node device Z1 may receive and aggregate data frames sent bya leaf node device Y1 and a leaf node device Y2. If a cluster headforwarding node device C4 is used as the first forwarding node device,the cluster head forwarding node device C4 may receive and aggregatedata frames sent by a leaf node device Y10 and an intermediateforwarding node device Z6. If the intermediate forwarding node device Z6is used as the first forwarding node device, the intermediate forwardingnode device Z6 may receive and aggregate data frames sent by a leaf nodedevice Y11 and an intermediate forwarding node device Z7. In addition,although not shown in FIG. 1, the cluster head forwarding node devicemay alternatively be connected to a plurality of leaf node devices toreceive and aggregate data frames sent by the plurality of leaf nodedevices, and the intermediate forwarding node device may alternativelybe connected to a plurality of intermediate forwarding node devices toreceive and aggregate data frames sent by the plurality of intermediateforwarding node devices.

Further, if the first node device is a leaf node device, the first dataframe sent by the first node device is usually a data frame that is notaggregated. If the first node device is an intermediate forwarding nodedevice, for example, an intermediate forwarding node device that belongsto a same cluster as the first forwarding node device, the first dataframe sent by the first node device may be a data frame that is notaggregated, or may be an aggregated frame.

For example, if the intermediate forwarding node device cannot aggregatedata frames, the intermediate forwarding node device may send, to thefirst forwarding node device, a data frame that is generated by theintermediate forwarding node device or it may forward, to the firstforwarding device, a received data frame that is sent by another nodedevice. If the intermediate forwarding node device does not have anaggregation capability but receives an aggregated frame sent by anothernode device, the intermediate forwarding node device may also forwardthe aggregated frame to the first forwarding node device. If theintermediate forwarding node device has the aggregation capability, theintermediate forwarding node device may aggregate a plurality ofreceived data frames and send the obtained aggregated frame to the firstforwarding node device.

Similarly, the second node device may be a leaf node device, or may bean intermediate forwarding node device. Correspondingly, the second dataframe may be a data frame that is not aggregated, or may be anaggregated frame.

In some embodiments, one of the first node device or the second nodedevice, or both the first node device and the second node device, maybelong to a cluster that is different from a cluster to which the firstforwarding node device belongs. For example, if the intermediateforwarding node device Z2 in FIG. 1 is used as the first forwarding nodedevice, a leaf node device Y3 (not shown in FIG. 1) connected to theintermediate forwarding node device Z2 may be in the same cluster as theintermediate forwarding node device Z2, but a cluster head forwardingnode device C2 connected to the intermediate forwarding node device Z2may be in a cluster different from the cluster of the intermediateforwarding node device Z2.

When the first node device and the first forwarding node device belongto different clusters, the first node device is usually a cluster headforwarding node device in a next hop, such as, for example, theintermediate forwarding node device Z2 and the cluster head forwardingnode device C2 in FIG. 1. Therefore, the first data frame sent by thefirst node device may be an aggregated frame. Certainly, even if thefirst node device is the cluster head forwarding node device, the firstnode device may not have the aggregation function, or may have theaggregation function but may not have a plurality of data frames foraggregation at a moment. In this case, the first node device may send,to the first forwarding node device, a data frame that is notaggregated.

Correspondingly, when the second node device and the first forwardingnode device belong to different clusters, the second data frame sent bythe second node device may be an aggregated frame, or may be a dataframe that is not aggregated.

Step 502: The first forwarding node device determines that a destinationMAC address in the first MAC header is the same as a destination MACaddress in the second MAC header, and the first forwarding node devicegenerates a first aggregated frame based on the first data frame and thesecond data frame.

Specifically, the generated first aggregated frame includes a firstaggregated MAC header and a first aggregated MSDU. A structure of theaggregated frame may be shown in FIG. 6. It should be understood that,although aggregation of two data frames is used as an example in thisembodiment of this application, more data frames may be furtheraggregated according to the frame aggregation method provided in thisapplication, and an MSDU in a generated aggregated frame may furtherinclude more sub-MSDUs.

A destination MAC address in the first aggregated MAC header is the sameas the destination MAC address in the first MAC header or thedestination MAC address in the second MAC header. Because thedestination MAC address in the first MAC header in the first data frameis the same as the destination MAC address in the second MAC header inthe second data frame, when generating the first aggregated frame, thefirst forwarding node device may obtain the destination MAC address fromthe first MAC header to generate the destination MAC address in thefirst aggregated MAC header in the aggregated frame, or may obtain thedestination MAC address from the second MAC header to generate theaggregated frame. Alternatively, in an application scenario, each nodesends collected data to a border router, and then the border routersends the data to an upper-layer application. A forwarding node devicethat has the aggregation function may pre-store a destination MACaddress, or pre-store a template of an aggregated frame, where thetemplate includes a destination MAC address. Because an aggregated MACheader of the aggregated frame includes the destination MAC address,each sub-MSDU does not need to include the destination MAC address, toreduce a large quantity of bytes occupied by a plurality of samedestination MAC addresses, thereby reducing packet overheads.

In addition, the first aggregated MSDU includes a first sub-MSDU and asecond sub-MSDU. The first sub-MSDU includes the first MSDU in the firstdata frame and a source MAC address in the first MAC header, as shown inFIG. 7; and the second sub-MSDU includes the second MSDU in the seconddata frame and a source MAC address in the second MAC header, and astructure is similar to that shown in FIG. 7.

Each sub-MSDU in the aggregated frame retains a source MAC address andan MSDU included in a data frame before aggregation, so that whenobtaining data reported by each node, the upper-layer application thatreceives the aggregated frame can map the data to the node, therebyfacilitating data statistics collection, data analysis, and datamanagement.

As described above, the first data frame may be a data frame that is notaggregated, or may be an aggregated frame, and the second data frame mayalso be a data frame that is not aggregated or an aggregated frame. In aspecific embodiment, if the first data frame received by the firstforwarding node device is an aggregated frame, and the received seconddata frame is a data frame that is not aggregated, the first forwardingnode device may add, to the first data frame, a sub-MSDU that isgenerated based on the second data frame, or may regenerate anaggregated MAC header, generate a sub-MSDU based on the first data frameand the second data frame, and aggregate and encapsulate the sub-MSDUinto a new aggregated frame.

For example, as shown in FIG. 8, the first data frame is an aggregatedframe, and includes the first MAC header and the first MSDU. The firstMSDU further includes the first sub-MSDU and the second sub-MSDU. Thesecond data frame is a data frame that is not aggregated, and includesthe second MAC header and the second MSDU. The first aggregated framethat is generated by the first forwarding node device based on the firstdata frame and the second data frame may be shown in the figure, andincludes the first aggregated MAC header and the first aggregated MSDU.The first aggregated MAC header may be consistent with the first MACheader in the first data frame. In some implementations, the firstaggregated MAC header may be inconsistent with the first MAC header. Forexample, if the first aggregated MAC header includes a frame sequencenumber, the first forwarding node device determines a sequence number inthe first aggregated frame based on a status of the data frame sent bythe first forwarding node device. For another example, if the firstaggregated MAC header includes an auxiliary security header, the firstforwarding node device may determine the auxiliary security header basedon a key that is used by the first forwarding node device to encrypt thedata frame. The first aggregated MSDU includes the first sub-MSDU, thesecond sub-MSDU, and a third sub-MSDU, where the third sub-MSDU includesthe source MAC address in the second MAC header and the second MSDU.

In this embodiment of this application, the first forwarding node deviceaggregates data frames that have a same destination MAC address, therebyhelping reduce packet overheads and a quantity of channel contentions.Especially, when each node device needs to periodically report a dataframe, a same sample period is set for each node. In this case, aplurality of node devices report data frames at a same moment or withina relatively short time period, and destination MAC addresses are thesame. In other words, the first forwarding node device may aggregate aplurality of data frames by using the frame aggregation method providedin this embodiment of this application, to reduce packet overheads and aquantity of channel contentions.

In a possible implementation, each sub-MSDU in the aggregated framefurther includes a length field, as shown in FIG. 9. The length field isused to indicate a length of each sub-MSDU. Because data informationreported by all nodes may be different, the lengths of all sub-MSDUs maybe different. Therefore, adding the length field to each sub-MSDUfacilitates a device that receives the aggregated frame to distinguishbetween a previous sub-MSDU and a current sub-MSDU.

It should be understood that the length field can facilitate anotherdevice to distinguish between a previous sub-MSDU and a current sub-MSDUwhen the device parses the aggregated frame, but the device may alsodistinguish between the two sub-MSDUs in another manner, such as, forexample, by inserting a separator between the two sub-MSDUs, or byidentifying a start position or an end position of a sub-MSDU based onother information.

In addition, each sub-MSDU may further include a sample time of data, tofacilitate the upper-layer application to perform statistics collectionand management based on the sample time and sampled data, as shown inFIG. 10.

The first sub-MSDU shown in FIG. 10 includes a reserved bit that is usedto distinguish between sub-MSDUs. As described above, each sub-MSDU mayalternatively have no reserved bit, and a previous sub-MSDU and acurrent sub-MSDU are distinguished based on other information such assub-MSDU information.

In a possible implementation, the aggregated MAC header in theaggregated frame may further include one or any combination of thefollowing information: frame control information, a sequence number, anauxiliary security header, and a header information element.Correspondingly, if the aggregated MAC header includes the foregoinginformation, the sub-MSDU in the aggregated frame may no longer includethe foregoing information, to further reduce packet overheads. In aspecific embodiment, a structure of the aggregated frame may be shown inFIG. 11.

Optionally, to facilitate the first forwarding node device to decrypt areceived data frame and aggregate and encapsulate information in thedata frame into the aggregated frame, each node in the Wi-SUN FAN mayuse a same encryption method, that is, keys indicated by auxiliarysecurity headers are the same, to simplify a decryption processperformed by the first forwarding node device. When generating theaggregated frame based on each received data frame, the first forwardingnode device also encrypts the aggregated frame by using an encryptionmethod that is the same as the encryption method of each node device.

Further, a physical layer header (PHY header) and/or an FCS may befurther added to the aggregated frame. As shown in FIG. 12,correspondingly, each sub-MSDU may no longer retain a physical layerheader and an FCS in a source data frame, so that when N data frames areaggregated, byte overheads of N−1 physical layer headers and the FCS canbe reduced. Information included in an FCS field may be verificationinformation of an aggregated frame that is generated by performingcalculation on the aggregated frame according to a preset method.

Optionally, the first forwarding node device may further aggregate onlydata frames whose data is collected and sent in a same sample period. Inthis case, a sample time information element may be further added to theaggregated frame. As shown in FIG. 13, correspondingly, each sub-MSDUmay no longer retain the sample time information element, to furtherreduce byte overheads. As shown in FIG. 13, the aggregated frame mayfurther include another payload information element and a payloadtermination information element. In this case, each sub-MSDU may nolonger retain another payload information element and the payloadtermination information element, to further reduce byte overheads.

Optionally, the first forwarding node device starts to generate thefirst aggregated frame after receiving the first data frame and thesecond data frame, or may generate the first aggregated frame based onthe first data frame and the second data frame before an agreed time atwhich the first forwarding node device reports the data frame. In somescenarios, for example, if a plurality of environment monitoring devicesneed to periodically report monitoring data, and a destination MACaddress of each of these data frames is the border router or anotherpreset address, the first forwarding node device may alternatively startto aggregate and encapsulate the first data frame after receiving thefirst data frame.

In the foregoing embodiment, that the first forwarding node devicegenerates the aggregated frame based on the first data frame and thesecond data frame is used as an example. However, according to the frameaggregation method provided in this application, more data frames may befurther aggregated, and if more data frames are aggregated, more packetoverheads are reduced, and a larger quantity of channel contentions arereduced. However, if more data frames are aggregated, a length of aformed aggregated frame is longer. If the length of the aggregated frameis excessively long, a transmission error may occur. To avoid thetransmission error, an upper limit may be set for the length of theaggregated frame. For example, if a frame length that can be supportedby a maximum physical layer payload in the Wi-SUN FAN is 2047 bytes, the2047 bytes may be used as the upper limit of the length of theaggregated frame.

When generating the aggregated data frame based on a plurality of dataframes, the first forwarding node device usually sequentially generates,in a receiving time sequence, a sub-MSDU based on each aggregated dataframe. Optionally, before generating a sub-MSDU based on a data frame,the first forwarding node device may first determine whether a length ofan aggregated frame exceeds a preset upper limit if the first forwardingnode device generates the sub-MSDU based on the data frame andaggregates and encapsulates the sub-MSDU into the aggregated frame. Ifthe length of the aggregated frame does not exceed the preset upperlimit, the first forwarding node device continues to perform aggregationand encapsulation; otherwise, the first forwarding node device does notcontinue to aggregate and encapsulate a new sub-MSDU into the aggregatedframe, but generates a new aggregated frame based on a data frame thatis not yet involved in aggregation and encapsulation.

In some embodiments, the first forwarding node device may also need toreport data. In this case, the first forwarding node device may generatethe data frame, then generate the sub-MSDU based on the generated dataframe, and aggregate and encapsulate the sub-MSDU into the aggregatedframe, or the first forwarding node device may generate the sub-MSDUbased on the data that needs to be reported, and aggregate andencapsulate the sub-MSDU into the aggregated frame.

Step 503: The first forwarding node device sends the first aggregatedframe to a second forwarding node device.

In a possible implementation, the first forwarding node device is anintermediate forwarding node device, and the second forwarding nodedevice may be a cluster head forwarding node device in a cluster inwhich the first forwarding node device is located. For example, if theintermediate forwarding node device Z1 shown in FIG. 1 is the firstforwarding node device, the second forwarding node device is the clusterhead forwarding node device C1. Alternatively, the second forwardingnode device may be an intermediate forwarding node device in a clusterin which the first forwarding node device is located. For example, ifthe intermediate forwarding node device Z7 shown in FIG. 1 is the firstforwarding node device, the second forwarding node device is theintermediate forwarding node device Z6.

In another possible implementation, the first forwarding node device isa cluster head forwarding node device, the second forwarding node deviceis an intermediate forwarding node device or a cluster head forwardingnode device, and the first forwarding node device and the secondforwarding node device belong to different clusters. For example, if thecluster head forwarding node device C2 in the cluster 2 shown in FIG. 1is the first forwarding node device, the second forwarding node deviceis the intermediate forwarding node device Z2 in the cluster 1. Inaddition, although not shown in FIG. 1, the cluster head forwarding nodedevice C2 in the cluster 2 may also be connected to the cluster headforwarding node device C1 in the cluster 1. In this latter case, if thecluster head forwarding node device C2 is the first forwarding nodedevice, the second forwarding node device is the cluster head forwardingnode device C1.

In another possible implementation, the first forwarding node device isa cluster head forwarding node device, the second forwarding node deviceis a border router, and the border router is located outside the Wi-SUNFAN. For example, if the cluster head forwarding node device C1 shown inFIG. 1 is the first forwarding node device, the second forwarding nodedevice is the border router.

When generating the aggregated frame based on a plurality of receiveddata frames, to reduce packet overheads, reduce a quantity of channelcontentions, and fully use a channel resource to a great extent, thefirst forwarding node device may need to wait for a time period, toreceive more data frames that can be aggregated and aggregate the dataframes. However, to ensure time validity of data, a deadline for sendingthe aggregated frame may be set for the first forwarding node device, toavoid a case in which the first forwarding node device cannot uploaddata that is collected by each node device to the upper-layerapplication in a timely manner due to a long-time wait.

In some embodiments, the first forwarding node device may furtherreceive a network setting frame from the border router, where thenetwork setting frame is used to indicate a time at which the firstforwarding node device reports the first aggregated frame and a time atwhich each of the first node device and the second node device collectsdata. The network setting frame is generated by the border router, andis delivered layer by layer by using each node device. FIG. 1 is stillused as an example. The border router sends the network setting frame tothe cluster head forwarding node device C1 and the cluster headforwarding node device C4, the cluster head forwarding node device C1sends the network setting frame to the routing forwarding node device Z1and the routing forwarding node device Z2, the routing forwarding nodedevice Z1 forwards the network setting frame to the leaf node device Y1and the leaf node device Y2, the routing forwarding node device Z2forwards the network setting frame to the leaf node device Y3 (not shownin FIG. 1) and the cluster head forwarding node device C2, and so on.

The first forwarding node device determines, based on the receivednetwork setting frame, a deadline for reporting the first aggregatedframe; and sends the first aggregated frame to the second forwardingnode device based on the deadline.

Further, the deadline may be set for only the cluster head forwardingnode device, and the deadline may not be set for the routing forwardingnode device. The deadline may alternatively be set for both the clusterhead forwarding node device and the routing forwarding node device.

An example in which the deadline is set for only the cluster headforwarding node device is used below for further description.

In a specific implementation, the network setting frame includes anetwork setting timestamp t_(c), a cluster hop count i, and a sampleperiod P.

The sample period P is used to instruct each node device (which mayinclude the leaf node device, the intermediate forwarding node device,and the cluster head forwarding node device) to collect data based onthe sample period and report the data. In an application scenario suchas smart metering and environment monitoring, each node device collectsdata once in each sample period and reports the data, and the clusterhead forwarding node device and/or the intermediate forwarding nodedevice aggregates data frames in each sample period and reports theaggregated data frame. Usually, sample periods of node devicescontrolled by one type of application are the same. For example, periodsfor reporting electricity consumption by smart meters are the same, andperiods for reporting an environment parameter by environment monitoringdevices are the same.

The network setting timestamp t_(c) is used to determine a referencetime of the sample period, for example, if the sample period is 60 s,t_(c) to t_(c)|60 s is a first sample period, t_(c)+60 s to t_(c)+120 sis a second sample period, and so on. Optionally, when sending thenetwork setting frame, the border router may use a sending time as thenetwork setting timestamp t_(c), so that each node device determines thesample period based on the network setting timestamp. When each clusterhead forwarding node device forwards the network setting frame to theintermediate forwarding node device or the leaf node device, or when theintermediate forwarding node device forwards the network setting frameto the leaf node device or a next-hop cluster head forwarding nodedevice, the network setting timestamp t_(c) is not changed, so that eachnode device has a uniform sample period and sample time.

The cluster hop count i represents a hop count to a cluster in which adestination node device is located from the border router that sends thenetwork setting frame. For example, the network architecture diagramshown in FIG. 1 is used as an example. A cluster hop count of each nodedevice in the cluster 1 and the cluster 4 may be set to 1, a cluster hopcount of each node device in the cluster 2 may be set to 2, and acluster hop count of each node device in the cluster 3 may be set to 3.Alternatively, a cluster hop count of each node device in the cluster 1and the cluster 4 may be set to 0, a cluster hop count of each nodedevice in the cluster 2 may be set to 1, and a cluster hop count of eachnode device in the cluster 3 may be set to 2.

The cluster head forwarding node device may obtain a first time based onthe network setting timestamp t_(c) and the sample period P, and removei deadline gradients ΔD from the first time, to obtain the deadline. Thedeadline gradient ΔD is used to indicate a time required by the clusterhead forwarding node device to send the aggregated frame to a forwardingnode device outside the cluster in which the cluster head forwardingnode device is located. The network architecture diagram shown in FIG. 1is still used as an example. If a deadline for sending an aggregatedframe by the cluster head forwarding node device C1 is T1, a deadlinefor sending the aggregated frame by the cluster head forwarding nodedevice C2 is T2=T1−ΔD, and a deadline for sending the aggregated frameby a cluster head forwarding node device C3 is T3=T1−2×ΔD.

Optionally, the deadline gradient ΔD may be included in the networksetting frame, or may be preconfigured in the first forwarding nodedevice.

In a specific embodiment, the cluster head forwarding node device maydetermine, based on a formula (1), a deadline D(i) for sending theaggregated frame by the cluster head forwarding node device:

D(i)=t _(c) +n×P−i×ΔD  (1), where

n represents a sample period sequence number.

Optionally, n may be calculated by the cluster head forwarding nodedevice. Specifically, the cluster head forwarding node device maydetermine a current sample period sequence number n based on a formula(2):

n=┌(t−t _(c))/P┐  (2), where

the symbol ┌⋅┐ represents rounding up, t represents a current time,t_(c) represents the network setting timestamp, and P represents thesample period.

Certainly, the cluster head forwarding node device may determine thesample period sequence number in another manner. For example, thecluster head forwarding node device may use a parameter that is used torepresent a quantity of sample times, and a value of the parameter isincreased by 1 each time one sample period elapses. This applicationsets no limitation on how to determine the sample period sequence numbern.

Further, the network setting frame may further include a sample timeadvance that is used to indicate a sample time of each node device in asample period. In a specific implementation, after receiving the networksetting frame, each node device may determine the sample time based on aformula (3):

t _(s) =t _(c) |n×PΔT  (3), where

t_(s) represents the sample time of the node device, n represents thesample period sequence number, P represents the sample period, ΔTrepresents the sample time advance, and t_(c) represents the networksetting timestamp. For example, if the sample period is 60 s, the sampletime advance is 1 s, and the network setting timestamp is 0.Correspondingly, each node performs sampling at (0+1×60−1)s for thefirst time, performs sampling at (0+2×60−1)s for the second time, and soon.

A method for determining the value of n by each node is similar to theforegoing method for determining the value of n by the cluster headforwarding node device. Details are not described herein again.

In a specific embodiment, a structure of the network setting frame maybe shown in FIG. 14, and includes a MAC layer header, a MAC layerpayload, and an FCS. The MAC layer header may further include a framecontrol field, a personal area network identifier, a source MAC address,a payload security header, and a header information element. Further, apayload information element field in FIG. 14 may specifically includeinformation shown in FIG. 15. A version number information element (PANversion IE) field and a frame aggregation information element (FAGG IE)field may be respectively shown in FIG. 16 and FIG. 17.

In a possible implementation, when the cluster hop count of each nodedevice in the cluster 1 and the cluster 4 is 1, the cluster hop count ofeach node device in the cluster 2 is 2, and the cluster hop count ofeach node device in the cluster 3 is 3, an initial value of a clusterhop count in the network setting frame sent by the border router maybe 1. When determining the deadline of the cluster head forwarding nodedevice C1 based on the network setting frame sent by the border router,and forwarding the network setting frame to another node device, thecluster head forwarding node device C1 increases the cluster hop countin the network setting frame by 1, so that the cluster head forwardingnode device C2 can calculate, based on the modified network settingframe, the deadline corresponding to the cluster head forwarding nodedevice C2. However, for each node device in the cluster 1, because onlythe sample time may be calculated, and the deadline does not need to becalculated, each node device is not affected when the cluster hop countchanges. When forwarding the network setting frame, the cluster headforwarding node device C2 increases the cluster hop count by 1 again, sothat the cluster head forwarding node device C3 can calculate, based onthe modified network setting frame, the deadline corresponding to thecluster head forwarding node device C3.

In another possible implementation, when the cluster hop count of eachnode device in the cluster 1 and the cluster 4 is 1, the cluster hopcount of each node device in the cluster 2 is 2, and the cluster hopcount of each node device in the cluster 3 is 3, an initial value of acluster hop count in the network setting frame sent by the border routermay be 0. The cluster head forwarding node device C1 first increases thecluster hop count in the network setting frame by 1, then calculates thedeadline, and forwards the network setting frame to the intermediateforwarding node device Z1 and the intermediate forwarding node deviceZ2, and the intermediate forwarding node device Z2 forwards the networksetting frame to the cluster head forwarding node device C2; and thecluster head forwarding node device C2 first increases the cluster hopcount in the network setting frame by 1, then calculates the deadline,and so on.

In addition, in the foregoing two implementations, the cluster hop countof each node device in the cluster 1 and the cluster 4 may alternativelybe 0, the cluster hop count of each node device in the cluster 2 mayalternatively be 1, and the cluster hop count of each node device in thecluster 3 may alternatively be 2.

To understand the frame aggregation method provided in this embodimentof this application more clearly, further descriptions are providedbelow by using a specific embodiment with reference to FIG. 1.

A user sets a network setting parameter by using the upper-layerapplication: The sample period is 60 s, the deadline gradient is 0.1 s,and the sample time advance is 1 s. The upper-layer application sendsthe foregoing network setting parameter to the border router over thenetwork. The border router generates the network setting frame. Thenetwork setting frame includes the following information: The networksetting timestamp is 0 s, the sample period is 60 s, the deadlinegradient is 0.1 s, the sample time advance is 1 s, and the cluster hopcount is 1.

The sample time of each node device is 60−1=59 s, and the cluster headforwarding node device C1 and the cluster head forwarding node device C4each obtain, based on the network setting frame through calculation,that the deadline for sending the aggregated frame is 60−0.1=59.9 s. Thecluster head forwarding node device C1 modifies the cluster hop count to2, and forwards the network setting frame to the routing forwarding nodedevices Z1 and Z2. The routing forwarding node device Z2 forwards thenetwork setting frame to the cluster head forwarding node device C2. Thecluster head forwarding node device C2 obtains, based on the networksetting frame through calculation, that the deadline for sending theaggregated frame is 60−2×0.1=59.8 s. The cluster head forwarding nodedevice C2 modifies the cluster hop count to 3, and forwards the networksetting frame to a routing forwarding node device Z4. The routingforwarding node device Z4 forwards the network setting frame to thecluster head forwarding node device C3. The cluster head forwarding nodedevice C3 determines, based on the network setting frame, that thedeadline for sending the aggregated frame is 60−3×0.1=59.7 s.

An embodiment of this application further provides a network settingframe sending method, to set a uniform sample period for each nodedevice in a same network, and set, for a forwarding node device in asame network, a deadline for sending an aggregated frame. FIG. 18 is aschematic flowchart of a network setting frame sending method accordingto an embodiment of this application. As shown in the figure, the methodmay include the following steps.

Step 1801: A border router obtains a network setting parameter.

In a possible implementation, the network setting parameter obtained bythe border router may be sent over a network. For example, a manager mayconfigure the network setting parameter in an upper-layer application,and send the network setting parameter to the border router over thenetwork.

The network setting parameter may include a sample period P that is usedto instruct a node device to collect data based on the sample period andreport the data.

Optionally, the network setting parameter may further include a deadlinegradient ΔD. Usually, for ease of management, deadline gradients in aparticular Wi-SUN FAN are the same. The network architecture diagramshown in FIG. 1 is still used as an example. If a deadline for sendingan aggregated frame by the cluster head forwarding node device C1 in thecluster 1 is T1, a deadline for sending the aggregated frame by thecluster head forwarding node device C2 in the cluster 2 is T2=T1−ΔD, anda deadline for sending the aggregated frame by the cluster headforwarding node device C3 in the cluster 3 is T3=T2−ΔD.

In a specific implementation, the manager may set the sample period andthe deadline gradient in the upper-layer application, and send thesample period and the deadline gradient to the border router over thenetwork. The manager may set different sample periods and differentdeadline gradients based on different application scenarios. Forexample, a sample period of a smart meter may be set to one month, tofacilitate statistics collection of electricity consumption andelectricity of a user. For another example, a sample period of anenvironment monitoring device may be set to one hour, to facilitatemonitoring of an environment status.

Further, the network setting parameter may further include a sample timeadvance that is used to indicate a sample time of the node device in asample period. For example, if the sample period is 60 s, and the sampletime advance is 1 s, it indicates that each node device collects data ata (60−1)^(th)s in each period and reports the data.

Step 1802: The border router generates a network setting frame based onthe network setting parameter.

Specifically, the network setting frame includes a network settingtimestamp t_(c), a cluster hop count i, and the sample period. Meaningsof the network setting timestamp t_(c) and the cluster hop count aresimilar to those in the foregoing method.

As described above, the network setting parameter may further includethe deadline gradient ΔD and/or the sample time advance.Correspondingly, the network setting frame generated by the borderrouter may further include the deadline gradient ΔD and/or the sampletime advance.

Step 1803: The border router sends the network setting frame to acluster head forwarding node device.

The border router may be connected to one or more cluster headforwarding node devices. Correspondingly, the border router may send thenetwork setting frame to the cluster head forwarding node deviceconnected to the border router, and the cluster head forwarding nodedevice further sends the network setting frame to a leaf node device, anintermediate forwarding node device, or a cluster head forwarding nodedevice in another cluster that is connected to the cluster headforwarding node device, to send the network setting frame to each nodedevice in the Wi-SUN FAN.

In a possible implementation, an initial cluster hop count set by theborder router is 1, and the border router sends the network settingframe to the cluster head forwarding node device C1 and the cluster headforwarding node device C4 in the cluster 4 shown in FIG. 1. The clusterhead forwarding node device C1 modifies the cluster hop count in thenetwork setting frame to 2, and forwards the network setting frame tothe intermediate forwarding node device Z1 and the intermediateforwarding node device Z2. The intermediate forwarding node device Z1forwards the network setting frame to the leaf node device Y1 and theleaf node device Y2. The intermediate forwarding node device Z2 sendsthe network setting frame to the cluster head forwarding node device C2.The cluster head forwarding node device C2 modifies the cluster hopcount in the network setting frame to 3, and forwards the networksetting frame to the intermediate forwarding node device Z3, theintermediate forwarding node device Z4, and the leaf node device Y4. Theintermediate forwarding node device Z4 sends the network setting frameto the cluster head forwarding node device C3.

In another possible implementation, an initial cluster hop count set bythe border router is 0, and the border router sends the network settingframe to the cluster head forwarding node device C1 and the cluster headforwarding node device C4 in the cluster 4 shown in FIG. 1. The clusterhead forwarding node device C1 increases the cluster hop count by 1, andforwards the modified network setting frame to the intermediateforwarding node device Z1 and the intermediate forwarding node deviceZ2. The intermediate forwarding node device Z1 forwards the networksetting frame to the leaf node device Y1 and the leaf node device Y2,and the intermediate forwarding node device Z2 sends the network settingframe to the cluster head forwarding node device C2. The cluster headforwarding node device C2 increases the cluster hop count by 1, andforwards the modified network setting frame to the intermediateforwarding node device Z3, the intermediate forwarding node device Z4,and the leaf node device Y4. The intermediate forwarding node device Z4sends the network setting frame to the cluster head forwarding nodedevice C3. The cluster head forwarding node device C3 increases thecluster hop count by 1, and forwards the modified network setting frameto an intermediate forwarding node device Z5 and a leaf node device Y7.

In a possible implementation, when generating the network setting frame,the border router may add a version number to the network setting frame,to facilitate each node to determine the updated network setting frame.For example, each time the border router receives a new network settingparameter, the border router regenerates a network setting frame basedon the new network setting parameter, and increases a version number inthe network setting frame by 1. Each node determines a sample period, adeadline for sending an aggregated frame, and the like based on anetwork setting frame with a largest version number; or each node maydelete a network setting frame with a relatively small version number,and only a network setting frame with the largest version number isretained. For another example, the border router may also generate aversion number based on a time at which the border router generates thenetwork setting frame, and each node determines a network setting framethat is lately generated as a network setting frame with the latestversion.

Specifically, a format of the network setting frame may be shown in FIG.14 to FIG. 17.

Based on a same technical concept, an embodiment of this applicationfurther provides a first forwarding node device, to implement theforegoing embodiment of the frame aggregation method. The firstforwarding node device may be applied to a Wi-SUN FAN, and the Wi-SUNFAN includes the first forwarding node device, a first node device, anda second node device.

Referring to FIG. 19, the first forwarding node device may include areceiving unit 1901, a determining unit 1902, a generation unit 1903,and a sending unit 1904.

Specifically, the receiving unit 1901 is configured to receive a firstdata frame sent by the first node device and a second data frame sent bythe second node device, where the first data frame includes a first MACheader and a first MSDU, and the second data frame includes a second MACheader and a second MSDU.

The determining unit 1902 is configured to determine whether adestination MAC address in the first MAC header is the same as adestination MAC address in the second MAC header.

When the determining unit 1902 determines that the destination MACaddress in the first MAC header is the same as the destination MACaddress in the second MAC header, the generation unit 1903 is configuredto generate a first aggregated frame based on the first data frame andthe second data frame, where the first aggregated frame includes a firstaggregated MAC header and a first aggregated MSDU, a destination MACaddress in the first aggregated MAC header is the same as thedestination MAC address in the first MAC header or the destination MACaddress in the second MAC header, the first aggregated MSDU includes afirst sub-MSDU and a second sub-MSDU, the first sub-MSDU includes thefirst MSDU and a source MAC address in the first MAC header, and thesecond sub-MSDU includes the second MSDU and a source MAC address in thesecond MAC header.

The sending unit 1904 is configured to send the first aggregated frameto a second forwarding node device.

In a possible implementation, the first node device is a leaf nodedevice or an intermediate forwarding node device, the second node deviceis a leaf node device or an intermediate forwarding node device, thefirst node device, the second node device, and the first forwarding nodedevice belong to a first cluster, and the Wi-SUN FAN includes the firstcluster.

When the first node device is the intermediate forwarding node device,the first data frame is a data frame or an aggregated frame.

When the second node device is the intermediate forwarding node device,the second data frame is a data frame or an aggregated frame.

In a possible implementation, the first node device is a cluster headforwarding node device, the first data frame is an aggregated frame, thesecond node device and the first forwarding node device belong to afirst cluster, the first node device belongs to a second cluster, theWi-SUN FAN includes the first cluster and the second cluster, and thefirst cluster and the second cluster are not a same cluster.

In a possible implementation, the first forwarding node device is anintermediate forwarding node device, the second forwarding node deviceis a cluster head forwarding node device or an intermediate forwardingnode device, the first forwarding node device and the second forwardingnode device are in a same cluster, and the Wi-SUN FAN includes thesecond forwarding node device.

In a possible implementation, the first forwarding node device is acluster head forwarding node device, the second forwarding node deviceis an intermediate forwarding node device or a cluster head forwardingnode device, the first forwarding node device and the second forwardingnode device are in different clusters, and the Wi-SUN FAN includes thesecond forwarding node device.

In a possible implementation, the first forwarding node device is acluster head forwarding node device, the second forwarding node deviceis a border router, and the border router is located outside the Wi-SUNFAN.

In a possible implementation, the first forwarding node device is acluster head forwarding node device, and the receiving unit 1901 isfurther configured to receive a network setting frame from a borderrouter, where the network setting frame is used to indicate a time atwhich the first forwarding node device reports the first aggregatedframe and a time at which each of the first node device and the secondnode device collects data.

The determining unit 1902 is further configured to determine, based onthe network setting frame, a deadline for reporting the first aggregatedframe.

The sending unit 1904 is specifically configured to send the firstaggregated frame to the second forwarding node device based on thedeadline.

In a possible implementation, the network setting frame includes anetwork setting timestamp, a cluster hop count, and a sample period, thenetwork setting timestamp is used to determine a reference time of thesample period, the cluster hop count represents a hop count to a clusterin which a destination node device is located from the border routerthat sends the network setting frame, and the sample period is used toinstruct the first node device and the second node device to collectdata based on the sample period.

When determining, based on the network setting frame, the deadline forreporting the first aggregated frame, the determining unit 1902 isconfigured to: obtain a first time based on the network settingtimestamp and the sample period; remove deadline gradients whosequantity is the cluster hop count from the first time, to obtain thedeadline, where the deadline gradient is used to indicate a timerequired by the first forwarding node device to send the firstaggregated frame to a forwarding node device outside the cluster inwhich the first forwarding node device is located; and increase thecluster hop count in the network setting frame by 1.

In a possible implementation, both the first sub-MSDU and the secondsub-MSDU include a length field, and the length field is used toindicate a length of a sub-MSDU.

Based on a same technical concept, an embodiment of this applicationfurther provides a first forwarding node device, to implement theforegoing embodiment of the frame aggregation method. The firstforwarding node device may be applied to a Wi-SUN FAN, and the Wi-SUNFAN includes the first forwarding node device, a first node device, anda second node device.

FIG. 20 is a schematic structural diagram of hardware of a firstforwarding node device according to an embodiment of this application.The first forwarding node device may include a processor 2001, a memory2002, an interface 2003, and a bus 2004. The interface 2003 may beimplemented in a wireless or wired manner, and may be a network adapter.The processor 2001, the memory 2002, and the interface 2003 areconnected by using the bus 2004.

The interface 2003 may specifically include a transmitter and areceiver, and may be configured to receive and send information betweenthe first forwarding node device and each of the first node device, thesecond node device, and a second forwarding node device. For example,the interface 2003 is configured to support steps 501 and 503 in FIG. 5.The processor 2001 is configured to perform processing that is performedby the first forwarding node device in the foregoing embodiments. Forexample, the processor 2001 is configured to support step 502 in FIG. 5.The memory 2002 includes an operating system 20021 and an applicationprogram 20022, and is configured to store a program, code, orinstructions. When executing the program, the code, or the instructions,the processor or a hardware device may complete a processing processrelated to the first forwarding node device in one or more of the methodembodiments. Optionally, the memory 2002 may include a read-only memory(ROM) and a random access memory (RAM). The ROM includes a basicinput/output system (BIOS) or an embedded system, and the RAM includesan application program and an operating system. When the firstforwarding node device needs to run, the BIOS built into the ROM or abootloader in the embedded system is used to boot a system to start, andboot the first forwarding node device to enter a normal running state.After entering the normal running state, the first forwarding nodedevice runs the application program and the operating system in the RAM,to complete a processing process related to the first forwarding nodedevice in the method embodiments.

It may be understood that FIG. 20 shows only a simplified design of thefirst forwarding node device. In actual application, the firstforwarding node device may include any quantity of interfaces,processors, or memories.

FIG. 21 is a schematic structural diagram of hardware of another firstforwarding node device according to an embodiment of this application.The first forwarding node device shown in FIG. 21 may performcorresponding steps that are performed by the first forwarding nodedevice in the foregoing embodiment of the frame aggregation method.

As shown in FIG. 21, the first forwarding node device includes a maincontrol board 2110, an interface board 2130, a switching board 2120, andan interface board 2140. The main control board 2110, the interfaceboard 2130, the interface board 2140, and the switching board 2120 areconnected to a platform backboard by using a system bus forinterworking. The main control board 2110 is configured to completefunctions such as system management, device maintenance, and protocolprocessing. The switching board 2120 is configured to complete dataexchange between interface boards (the interface board is also referredto as a line card or a service board). The interface board 2130 and theinterface board 2140 are configured to provide various serviceinterfaces, and forward a data packet.

The interface board 2130 may include a central processing unit 2131, aforwarding entry memory 2134, a physical interface card 2133, and anetwork processor 2132. The central processing unit 2131 is configuredto control and manage the interface board, and communicate with acentral processing unit 2111 on the main control board 2110. Theforwarding entry memory 2134 is configured to store a forwarding entry.The physical interface card 2133 is configured to receive and send adata frame. The network processor 2132 is configured to control, basedon the forwarding entry, the physical interface card 2133 to receive andsend a data frame.

Specifically, the physical interface card 2133 receives a first dataframe and a second data frame, and sends the first data frame and thesecond data frame to the central processing unit 2111 on the maincontrol board 2110 by using the central processing unit 2131. Thecentral processing unit 2111 is configured to obtain the first dataframe and the second data frame, and generate a first aggregated frame.The physical interface card 2133 is further configured to send the firstaggregated frame to the second forwarding node device.

The central processing unit 2131 is further configured to control thenetwork processor 2132 to obtain the forwarding entry in the forwardingentry memory 2134. In addition, the central processing unit 2131 isfurther configured to control the network processor 2132 to receive andsend a data frame by using the physical interface card 2133.

It should be understood that an operation on the interface board 2140 isconsistent with an operation on the interface board 2130 in thisembodiment of the present application. For brevity, details are notdescribed. It should be understood that the first forwarding node devicein this embodiment may correspond to functions and/or steps implementedin the foregoing embodiments of the frame aggregation method.

In addition, it should be noted that there may be one or more maincontrol boards. When there are a plurality of main control boards, aprimary main control board and a secondary main control board may beincluded. There may be one or more interface boards, and the firstforwarding node device with a stronger data processing capabilityprovides more interface boards. There may be one or more physicalinterface cards on the interface board. There may be no switching board,or there may be one or more switching boards. When there are a pluralityof switching boards, load sharing and redundancy backup may be jointlyimplemented by the plurality of switching boards. In a centralizedforwarding architecture, the first forwarding node device may not need aswitching board, and the interface board is responsible for a servicedata processing function of an entire system. In a distributedforwarding architecture, the first forwarding node device may have atleast one switching board, and data exchange between a plurality ofinterface boards is implemented by using the switching board, to providea large-capacity data exchange and processing capability. Therefore, adata access and processing capability of the first forwarding nodedevice in the distributed architecture is better than that of a devicein the centralized architecture. A specific architecture to be useddepends on a specific networking deployment scenario. This is notlimited herein.

FIG. 22 is a schematic structural diagram of hardware of still anotherfirst forwarding node device according to an embodiment of thisapplication. The first forwarding node device shown in FIG. 22 mayperform corresponding steps that are performed by the first forwardingnode device in the method in the foregoing embodiment.

Such a product form of the first forwarding node device is applicable toa network architecture (for example, software-defined network (SDN)) inwhich control and forwarding are separated. In the SDN, the main controlboard 2110 of the first forwarding node device shown in FIG. 21 isseparated from the device, and forms a new independent physical device(namely, a controller 2110A shown in FIG. 22), and remaining componentsform another independent physical device (namely, a first forwardingsub-device 2100A shown in FIG. 22). The controller 2110A interacts withthe first forwarding sub-device 2100A by using a control channelprotocol. The control channel protocol may be an open flow protocol, apath computation element communication protocol (PCEP), a border gatewayprotocol (BGP), an interface to the routing system (I2RS), or the like.In other words, compared with the foregoing embodiment corresponding toFIG. 21, the first forwarding node device in this embodiment includesthe separated controller 2110A and the first forwarding sub-device2100A.

The controller 2110A may be implemented based on a general-purposephysical server or a special-purpose hardware structure. In an example,the controller includes a receiver, a processor, a transmitter, a RAM, aROM, and a bus (not shown). The processor is coupled to the receiver,the transmitter, the RAM, and the ROM by using the bus. When thecontroller needs to run, a BIOS built into the ROM or a bootloader in anembedded system is used to boot a system to start, and boot thecontroller to enter a normal running state. After entering the normalrunning state, the controller runs an application program and anoperating system in the RAM, so that the processor performs allfunctions and steps of the main control board 2110 in FIG. 21.

The first forwarding sub-device 2100A may be implemented based on aspecial-purpose hardware structure. A function and a structure of thefirst forwarding sub-device 2100A is consistent with functions andstructures of the interface board 2130, the interface board 2140, andthe switching board 2120 in FIG. 21, to perform corresponding functionsand steps. Alternatively, the first forwarding sub-device 2100A may be avirtual first forwarding sub-device implemented based on thegeneral-purpose physical server and a network functions virtualization(NFV) technology, and the virtual first forwarding sub-device is avirtual router. In a scenario of the virtual first forwardingsub-device, the interface board, the switching board, and the processorthat are included in the foregoing physical first forwarding sub-devicein the embodiment of the first forwarding sub-device may be consideredas an interface resource, a network resource, and a processing resourcethat are allocated by the first forwarding sub-device to the virtualfirst forwarding sub-device by using the general-purpose physical serverin a virtual environment. For a specific implementation of implementingfunctions or steps of the first forwarding sub-device by using thegeneral-purpose physical server, or implementing functions or steps ofthe first forwarding sub-device by using the general-purpose physicalserver and the NFV technology, refer to the embodiment in FIG. 20.

It should be understood that in this embodiment, the controller 2110Aand the first forwarding sub-device 2100A in the first forwarding nodedevice may implement various functions and steps implemented by thefirst forwarding node device in the method embodiment.

Based on a same technical concept, an embodiment of this applicationfurther provides a border router, to implement the foregoing embodimentof the network setting frame sending method. Referring to FIG. 23, theborder router provided in this embodiment of this application mayinclude an obtaining unit 2301, a generation unit 2302, and a sendingunit 2303.

Specifically, the obtaining unit 2301 is configured to obtain a networksetting parameter, where the network setting parameter includes a sampleperiod, and the sample period is used to instruct a node device tocollect data based on the sample period.

The generation unit 2302 is configured to generate a network settingframe based on the network setting parameter, where the network settingframe includes a network setting timestamp, a cluster hop count, and thesample period, the network setting timestamp is used to determine areference time of the sample period, and the cluster hop countrepresents a hop count to a cluster in which a destination node deviceis located from the border router that sends the network setting frame.

The sending unit 2303 is configured to send the network setting frame toa cluster head forwarding node device, where the cluster head forwardingnode device is located in a first cluster in a Wi-SUN FAN, and the firstcluster communicates with the border router by using the cluster headforwarding node device.

In a possible implementation, the network setting parameter furtherincludes a sample time advance, and the sample time advance is used toindicate a sample time of the node device in a sample period; and thenetwork setting frame further includes the sample time advance.

In a possible implementation, the obtaining unit 2301 is furtherconfigured to receive, by the border router, an aggregated frame sent bythe cluster head forwarding node device. The aggregated frame isobtained by aggregating a first data frame sent by a first node deviceand a second data frame sent by a second node device, the first nodedevice and the second node device belong to the Wi-SUN FAN, the firstdata frame includes a first media access control MAC header and a firstMAC service data unit MSDU, the second data frame includes a second MACheader and a second MSDU, a destination MAC address in the first MACheader is the same as a destination MAC address in the second MACheader, the aggregated frame includes a first aggregated MAC header anda first aggregated MSDU, a destination MAC address in the firstaggregated MAC header is the same as the destination MAC address in thefirst MAC header or the destination MAC address in the second MACheader, the first aggregated MSDU includes a first sub-MSDU and a secondsub-MSDU, the first sub-MSDU includes the first MSDU and a source MACaddress in the first MAC header, and the second sub-MSDU includes thesecond MSDU and a source MAC address in the second MAC header.

Based on a same technical concept, an embodiment of this applicationfurther provides a border router, to implement the foregoing embodimentof the network setting frame sending method.

FIG. 24 is a schematic structural diagram of hardware of a border routeraccording to an embodiment of this application. The border router mayinclude a processor 2401, a memory 2402, an interface 2403, and a bus2404. The interface 2403 may be implemented in a wireless or wiredmanner, and may be specifically a network adapter. The processor 2401,the memory 2402, and the interface 2403 are connected by using the bus2404.

The interface 2403 may specifically include a transmitter and areceiver, and may be configured to receive and send information betweenthe border router and the cluster head forwarding node device in theforegoing embodiment. The processor 2401 is configured to performprocessing that is performed by the border router in the foregoingembodiment. The memory 2402 includes an operating system 24021 and anapplication program 24022, and is configured to store a program, code,or an instruction. When executing the program, the code, or theinstruction, the processor or a hardware device may complete aprocessing process related to the border router in the methodembodiment. Optionally, the memory 2402 may include a ROM and a RAM. TheROM includes a BIOS or an embedded system, and the RAM includes anapplication program and an operating system. When the border routerneeds to run, the BIOS built into the ROM or a bootloader in theembedded system is used to boot a system to start, and boot the borderrouter to enter a normal running state. After entering the normalrunning state, the border router runs the application program and theoperating system in the RAM, to complete a processing process related tothe border router in the method embodiment.

It may be understood that FIG. 24 shows only a simplified design of theborder router. In actual application, the border router may include anyquantity of interfaces, processors, or memories.

FIG. 25 is a schematic structural diagram of hardware of another borderrouter according to an embodiment of this application. The border routershown in FIG. 25 may perform corresponding steps that are performed bythe border router in the foregoing embodiment of the network settingframe sending method.

As shown in FIG. 25, the border router includes a main control board2510, an interface board 2530, a switching board 2520, and an interfaceboard 2540. The main control board 2510, the interface board 2530, theinterface board 2540, and the switching board 2520 are connected to aplatform backboard by using a system bus for interworking. The maincontrol board 2510 is configured to complete functions such as systemmanagement, device maintenance, and protocol processing. The switchingboard 2520 is configured to complete data exchange between interfaceboards (the interface board is also referred to as a line card or aservice board). The interface board 2530 and the interface board 2540are configured to provide various service interfaces, and forward a datapacket.

The interface board 2530 may include a central processing unit 2531, aforwarding entry memory 2534, a physical interface card 2533, and anetwork processor 2532. The central processing unit 2531 is configuredto control and manage the interface board, and communicate with acentral processing unit 2511 on the main control board 2510. Theforwarding entry memory 2534 is configured to store a forwarding entry.The physical interface card 2533 is configured to send a network settingframe, and receive an aggregated frame. The network processor 2532 isconfigured to control, based on the forwarding entry, the physicalinterface card 2133 to receive and send the network setting frame or theaggregated frame.

Specifically, the physical interface card 2533 may receive a networksetting parameter from an upper-layer application, and send the networksetting parameter to the central processing unit 2511 on the maincontrol board 2510 by using the central processing unit 2531. Thecentral processing unit 2511 is configured to obtain the network settingparameter and generate the network setting frame. The physical interfacecard 2533 is further configured to send the network setting frame to thecluster head forwarding node device.

The central processing unit 2531 is further configured to control thenetwork processor 2532 to obtain the forwarding entry in the forwardingentry memory 2534. In addition, the central processing unit 2531 isfurther configured to control the network processor 2532 to receive andsend a data frame by using the physical interface card 2533.

It should be understood that an operation on the interface board 2540 isconsistent with an operation on the interface board 2530 in thisembodiment of the present application. It should be understood that theborder router in this embodiment may correspond to functions and/orsteps implemented in one or more of the foregoing embodiments of thenetwork setting frame sending method.

In addition, it should be noted that there may be one or more maincontrol boards. When there are a plurality of main control boards, aprimary main control board and a secondary main control board may beincluded. There may be one or more interface boards, and the borderrouter with a stronger data processing capability provides moreinterface boards. There may be one or more physical interface cards onthe interface board. There may be no switching board, or there may beone or more switching boards. When there are a plurality of switchingboards, load sharing and redundancy backup may be jointly implemented bythe plurality of switching boards. In a centralized forwardingarchitecture, the border router may not need a switching board, and theinterface board is responsible for a service data processing function ofan entire system. In a distributed forwarding architecture, the borderrouter may have at least one switching board, and data exchange betweena plurality of interface boards is implemented by using the switchingboard, to provide a large-capacity data exchange and processingcapability. Therefore, a data access and processing capability of theborder router in the distributed architecture is better than that of adevice in the centralized architecture. A specific architecture to beused depends on a specific networking deployment scenario.

FIG. 26 is a schematic structural diagram of hardware of still anotherborder router according to an embodiment of this application. The borderrouter shown in FIG. 26 may perform corresponding steps that areperformed by the border router in the method in the foregoingembodiment.

Such a product form of the border router is applicable to a networkarchitecture (for example, software-defined network (SDN)) in whichcontrol and forwarding are separated. In the SDN, the main control board2510 of the border router shown in FIG. 25 is separated from the device,and forms a new independent physical device (namely, a controller 2510Ashown in FIG. 26), and remaining components form another independentphysical device (namely, a first forwarding sub-device 2500A shown inFIG. 26). The controller 2510A interacts with the first forwardingsub-device 2500A by using a control channel protocol. The controlchannel protocol may be an open flow protocol, a PCEP, a BGP, an I2RS,or the like. In other words, compared with the foregoing embodimentcorresponding to FIG. 25, the border router in this embodiment includesthe separated controller 2510A and the first forwarding sub-device2500A.

The controller 2510A may be implemented based on a general-purposephysical server or a special-purpose hardware structure. In an example,the controller includes a receiver, a processor, a transmitter, a RAM, aROM, and a bus (not shown). The processor is coupled to the receiver,the transmitter, the RAM, and the ROM by using the bus. When thecontroller needs to run, a BIOS built into the ROM or a bootloader in anembedded system is used to boot a system to start, and boot thecontroller to enter a normal running state. After entering the normalrunning state, the controller runs an application program and anoperating system in the RAM, so that the processor performs allfunctions and steps of the main control board 2510 in FIG. 25.

The first forwarding sub-device 2500A may be implemented based on aspecial-purpose hardware structure. A function and a structure of thefirst forwarding sub-device 2500A is consistent with functions andstructures of the interface board 2530, the interface board 2540, andthe switching board 2520 in FIG. 25, to perform corresponding functionsand steps. Alternatively, the first forwarding sub-device 2500A may be avirtual first forwarding sub-device implemented based on thegeneral-purpose physical server and a network function virtualization(NFV) technology, and the virtual first forwarding sub-device is avirtual router. In a scenario of the virtual first forwardingsub-device, the interface board, the switching board, and the processorthat are included in the foregoing first forwarding sub-device in theembodiment of the physical border router may be considered as aninterface resource, a network resource, and a processing resource thatare allocated by the first forwarding sub-device to the virtual firstforwarding sub-device by using the general-purpose physical server in avirtual environment. For a specific implementation of implementingfunctions or steps of the first forwarding sub-device by using thegeneral-purpose physical server, or implementing functions or steps ofthe first forwarding sub-device by using the general-purpose physicalserver and the NFV technology, refer to the embodiment in FIG. 24.

It should be understood that, in this embodiment, the controller 2510Aand the first forwarding sub-device 2500A in the border router mayimplement various functions and steps implemented by the border routerin the method embodiment. For brevity, details are not described hereinagain.

Based on a same technical concept, an embodiment of this applicationfurther provides a Wi-SUN FAN. The Wi-SUN FAN includes at least onefirst forwarding node device. The first forwarding node device may bethe first forwarding node device in any one of the foregoingembodiments.

Based on a same technical concept, an embodiment of this applicationfurther provides a computer-readable storage medium. Thecomputer-readable storage medium stores a computer instruction, and whenthe instruction is run on a computer, the computer is enabled to performany one of the embodiments of the frame aggregation method and thenetwork setting frame sending method.

A person skilled in the art should understand that the embodiments ofthis application may be provided as a method, a system, or a computerprogram product. Therefore, this application may use a form of hardwareonly embodiments, software only embodiments, or embodiments with acombination of software and hardware. Moreover, this application may usea form of a computer program product that is implemented on one or morecomputer-usable storage media (including but not limited to a diskmemory, a CD-ROM, an optical memory, and the like) that include computerusable program code.

This application is described with reference to the flowcharts and/orblock diagrams of the method, the device (system), and the computerprogram product according to this application. It should be understoodthat computer program instructions may be used to implement each processand/or each block in the flowcharts and/or the block diagrams and acombination of a process and/or a block in the flowcharts and/or theblock diagrams. These computer program instructions may be provided fora general-purpose computer, a special-purpose computer, an embeddedprocessor, or a processor of another programmable data processing deviceto generate a machine, so that the instructions executed by a computeror a processor of another programmable data processing device generatean apparatus for implementing a specific function in one or moreprocesses in the flowcharts and/or in one or more blocks in the blockdiagrams.

These computer program instructions may be stored in a computer-readablememory that can instruct the computer or another programmable dataprocessing device to work in a specific manner, so that the instructionsstored in the computer-readable memory generate an artifact thatincludes an instruction apparatus. The instruction apparatus implementsa specific function in one or more processes in the flowcharts and/or inone or more blocks in the block diagrams.

These computer program instructions may be loaded onto a computer oranother programmable data processing device, so that a series ofoperations and steps are performed on the computer or anotherprogrammable device, thereby generating computer-implemented processing.Therefore, the instructions executed on the computer or anotherprogrammable device provide steps for implementing a specific functionin one or more processes in the flowcharts and/or in one or more blocksin the block diagrams.

A person skilled in the art may make various modifications andvariations to embodiments described in this application withoutdeparting from the spirit and scope of this application. In this way,this application is intended to cover these modifications and variationsof this application provided that they fall within the scope ofprotection defined by the claims of this application and theirequivalent technologies.

What is claimed is:
 1. A frame aggregation method applied to a wirelesssmart ubiquitous network (Wi-SUN) field area network (FAN) comprising afirst forwarding node device, a first node device, and a second nodedevice, and the method comprises: receiving, by the first forwardingnode device, a first data frame sent by the first node device and asecond data frame sent by the second node device, wherein the first dataframe comprises a first media access control (MAC) header and a firstMAC service data unit (MSDU), and the second data frame comprises asecond MAC header and a second MSDU; determining, by the firstforwarding node device, that a destination MAC address in the first MACheader is the same as a destination MAC address in the second MACheader; generating, by the first forwarding node device, a firstaggregated frame based on the first data frame and the second dataframe, wherein the first aggregated frame comprises a first aggregatedMAC header and a first aggregated MSDU, a destination MAC address in thefirst aggregated MAC header is the same as the destination MAC addressin the first MAC header or the destination MAC address in the second MACheader, the first aggregated MSDU comprises a first sub-MSDU and asecond sub-MSDU, the first sub-MSDU comprises the first MSDU and asource MAC address in the first MAC header, and the second sub-MSDUcomprises the second MSDU and a source MAC address in the second MACheader; and sending, by the first forwarding node device, the firstaggregated frame to a second forwarding node device.
 2. The methodaccording to claim 1, wherein the first node device is a leaf nodedevice or an intermediate forwarding node device, and the second nodedevice is a leaf node device or an intermediate forwarding node device;wherein the first node device, the second node device, and the firstforwarding node device are in a first cluster in the Wi-SUN FAN; whenthe first node device is the intermediate forwarding node device, thefirst data frame is a data frame or an aggregated frame; and when thesecond node device is the intermediate forwarding node device, thesecond data frame is a data frame or an aggregated frame.
 3. The methodaccording to claim 1, wherein the first node device is a cluster headforwarding node device, the first data frame is an aggregated frame, thesecond node device and the first forwarding node device are in a firstcluster in the Wi-SUN FAN, the first node device is in a second clusterin the Wi-SUN FAN, and the first cluster and the second cluster are nota same cluster.
 4. The method according to claim 1, wherein the firstforwarding node device is an intermediate forwarding node device, thesecond forwarding node device is a cluster head forwarding node deviceor an intermediate forwarding node device, the first forwarding nodedevice and the second forwarding node device are in a same cluster, andthe Wi-SUN FAN comprises the second forwarding node device.
 5. Themethod according to claim 1, wherein the first forwarding node device isa cluster head forwarding node device, the second forwarding node deviceis an intermediate forwarding node device or a cluster head forwardingnode device, the first forwarding node device and the second forwardingnode device are in different clusters, and the Wi-SUN FAN comprises thesecond forwarding node device.
 6. The method according to claim 1,wherein the first forwarding node device is a cluster head forwardingnode device, the second forwarding node device is a border routerlocated outside the Wi-SUN FAN.
 7. The method according to claim 1,wherein the first forwarding node device is a cluster head forwardingnode device, and the method further comprises: receiving, by the firstforwarding node device, a network setting frame from a border router,wherein the network setting frame indicates a time at which the firstforwarding node device reports the first aggregated frame and a time atwhich each of the first node device and the second node device collectsdata; and determining, by the first forwarding node device based on thenetwork setting frame, a deadline for reporting the first aggregatedframe; and the sending, by the first forwarding node device, the firstaggregated frame to a second forwarding node device comprises sending,by the first forwarding node device, the first aggregated frame to thesecond forwarding node device based on the deadline.
 8. The methodaccording to claim 7, wherein the network setting frame comprises anetwork setting timestamp, a cluster hop count, and a sample period, thenetwork setting timestamp being used to determine a reference time ofthe sample period, the cluster hop count representing a hop count to acluster in which a destination node device is located from the borderrouter that sends the network setting frame, and the sample period beingused to instruct the first node device and the second node device tocollect data based on the sample period; and the determining, by thefirst forwarding node device based on the network setting frame, adeadline for reporting the first aggregated frame comprises: obtaining,by the first forwarding node device, a first time based on the networksetting timestamp and the sample period; removing, by the firstforwarding node device from the first time, deadline gradients whosequantity is the cluster hop count, to obtain the deadline, wherein thedeadline gradient is used to indicate a time required by the firstforwarding node device to send the first aggregated frame to aforwarding node device outside the cluster in which the first forwardingnode device is located; and increasing, by the first forwarding nodedevice, the cluster hop count in the network setting frame by
 1. 9. Themethod according to claim 1, wherein the first sub-MSDU and the secondsub-MSDU each comprises a length field indicating a length of asub-MSDU.
 10. A first forwarding node device in a wireless smartubiquitous network (Wi-SUN) field area network (FAN) which comprises thefirst forwarding node device, a first node device, and a second nodedevice, and the first forwarding node device comprises: a receiver,configured to receive a first data frame sent by the first node deviceand a second data frame sent by the second node device, wherein thefirst data frame comprises a first media access control (MAC) header anda first MAC service data unit (MSDU), and the second data framecomprises a second MAC header and a second MSDU; a processor, configuredto: determine that a destination MAC address in the first MAC header isthe same as a destination MAC address in the second MAC header, andgenerate a first aggregated frame based on the first data frame and thesecond data frame, wherein the first aggregated frame comprises a firstaggregated MAC header and a first aggregated MSDU, a destination MACaddress in the first aggregated MAC header is the same as thedestination MAC address in the first MAC header or the destination MACaddress in the second MAC header, the first aggregated MSDU comprises afirst sub-MSDU and a second sub-MSDU, the first sub-MSDU comprises thefirst MSDU and a source MAC address in the first MAC header, and thesecond sub-MSDU comprises the second MSDU and a source MAC address inthe second MAC header; and a transmitter, configured to send the firstaggregated frame to a second forwarding node device.
 11. The firstforwarding node device according to claim 10, wherein the first nodedevice is a leaf node device or an intermediate forwarding node device,and the second node device is a leaf node device or an intermediateforwarding node device, wherein the first node device, the second nodedevice, and the first forwarding node device are in a first cluster, inthe Wi-SUN FAN; when the first node device is the intermediateforwarding node device, the first data frame is a data frame or anaggregated frame; and when the second node device is the intermediateforwarding node device, the second data frame is a data frame or anaggregated frame.
 12. The first forwarding node device according toclaim 10, wherein the first node device is a cluster head forwardingnode device, the first data frame is an aggregated frame, the secondnode device and the first forwarding node device are in a first clusterin the Wi-SUN FAN, the first node device is in a second cluster in theWi-SUN FAN and the first cluster and the second cluster are not a samecluster.
 13. The first forwarding node device according to claim 10,wherein the first forwarding node device is an intermediate forwardingnode device, the second forwarding node device is a cluster headforwarding node device or an intermediate forwarding node device, thefirst forwarding node device and the second forwarding node device arein a same cluster, and the Wi-SUN FAN comprises the second forwardingnode device.
 14. The first forwarding node device according to claim 10,wherein the first forwarding node device is a cluster head forwardingnode device, the second forwarding node device is an intermediateforwarding node device or a cluster head forwarding node device, thefirst forwarding node device and the second forwarding node device arein different clusters, and the Wi-SUN FAN comprises the secondforwarding node device.
 15. The first forwarding node device accordingto claim 10, wherein the first forwarding node device is a cluster headforwarding node device, the second forwarding node device is a borderrouter is located outside the Wi-SUN FAN.
 16. The first forwarding nodedevice according to claim 10, wherein the first forwarding node deviceis a cluster head forwarding node device; the receiver is furtherconfigured to receive a network setting frame from a border router,wherein the network setting frame indicates a time at which the firstforwarding node device reports the first aggregated frame and a time atwhich each of the first node device and the second node device collectsdata; the processor is further configured to determine, based on thenetwork setting frame, a deadline for reporting the first aggregatedframe; and the transmitter is configured to send the first aggregatedframe to the second forwarding node device based on the deadline. 17.The first forwarding node device according to claim 16, wherein thenetwork setting frame comprises a network setting timestamp, a clusterhop count, and a sample period, the network setting timestamp being usedto determine a reference time of the sample period, the cluster hopcount representing a hop count to a cluster in which a destination nodedevice is located from the border router that sends the network settingframe, and the sample period being used to instruct the first nodedevice and the second node device to collect data based on the sampleperiod; and when determining, based on the network setting frame, thedeadline for reporting the first aggregated frame, the processor isconfigured to: obtain a first time based on the network settingtimestamp and the sample period; remove, from the first time, deadlinegradients whose quantity is the cluster hop count, to obtain thedeadline, wherein the deadline gradient is used to indicate a timerequired by the first forwarding node device to send the firstaggregated frame to a forwarding node device outside the cluster inwhich the first forwarding node device is located; and increase thecluster hop count in the network setting frame by
 1. 18. A border routercomprising a processor configured to: generate a network setting framebased on an obtained network setting parameter, wherein the networksetting parameter comprises a sample period used to instruct a nodedevice to collect data based on the sample period, the network settingframe comprises a network setting timestamp, a cluster hop count, andthe sample period, the network setting timestamp is used to determine areference time of the sample period, and the cluster hop countrepresents a hop count to a cluster in which a destination node deviceis located from the border router; and a transmitter, configured to sendthe network setting frame to a cluster head forwarding node device,wherein the cluster head forwarding node device is located in a firstcluster in a wireless smart ubiquitous network (Wi-SUN) field areanetwork (FAN), and the first cluster communicates with the border routerby using the cluster head forwarding node device.
 19. The border routeraccording to claim 18, wherein the network setting parameter furthercomprises a sample time advance, and the sample time advance is used toindicate a sample time of the node device in a sample period; and thenetwork setting frame further comprises the sample time advance.
 20. Theborder router according to claim 18, further comprising: a receiver,configured to receive an aggregated frame sent by the cluster headforwarding node device, wherein the aggregated frame is obtained byaggregating a first data frame sent by a first node device and a seconddata frame sent by a second node device, the first node device and thesecond node device belong to the Wi-SUN FAN, the first data framecomprises a first media access control (MAC) header and a first MACservice data unit (MSDU), the second data frame comprises a second MACheader and a second MSDU, a destination MAC address in the first MACheader is the same as a destination MAC address in the second MACheader, the aggregated frame comprises a first aggregated MAC header anda first aggregated MSDU, a destination MAC address in the firstaggregated MAC header is the same as the destination MAC address in thefirst MAC header or the destination MAC address in the second MACheader, the first aggregated MSDU comprises a first sub-MSDU and asecond sub-MSDU, the first sub-MSDU comprises the first MSDU and asource MAC address in the first MAC header, and the second sub-MSDUcomprises the second MSDU and a source MAC address in the second MACheader.